<?php 
$_thumbnail = $this->get_data('thumbnail') ? $this->get_data('thumbnail') : 'img/icon/blueprint.png';
$_node_type = $this->get_data('type');
$_node_id = (int) $this->get_data('id');
if ($_node_id <= 0) tos_die();
$_parent_id = (int) $this->get_data('parent_id');
?>
<div class="left">
<div id="parent_node_container"><?php if ($_parent_id > 0) m('node')->block_node($_parent_id, array('description_length' => 80))->display();?></div>
<div id="prev_nodes_container">
    <?php m('node')->block_prev_nodes($_node_id)->display();?>
</div>
</div>
<div class="right">
<div id="next_nodes_container">
    <?php m('node')->block_next_nodes($_node_id)->display();?>
</div>
</div>
<div id="node_detail" class="box">
<div class="thumbnail">
    <?php echo tos_img($_thumbnail);?>
</div>
<h1><?php $this->write('caption');?></h1>
<div class="action">
        <ul class="inline-block">
            <li class="action"><a href="<?php echo tos_router_url(array('m' => $_node_type, 'a' => 'edit', 'node_id' => $_node_id));?>">Edit</a></li>
            <li class="action"><a onclick="remove_node();" href="javascript:;">Remove</a></li>
            <li class="action"><a href="http://test.rd-factory.cc/<?php echo tos_http_get('url');?>" target="_blank">View</a></li>
        </ul>
    </div>
<?php m('node')->block_node_keywords($this->get_data('id'))->display();?>
<div class="description"><?php $this->write('description')?></div>
<div class="clear"></div>
<div class="content">
<?php $this->display_box();?>
</div>
</div><!-- End #node_detail -->
<div class="children">
<?php m('node')->block_nodes_by_parent_id($_node_id)->display();?>
</div>
<input id="current_node_id" type="hidden" value="<?php $this->write('id');?>" />
<script type="text/javascript">
function remove_node() {
    if (confirm('Are you sure you want to remove this node?')) {
        window.location = '<?php echo tos_router_url(array('m' => $_node_type, 'a' => 'remove', 'node_id' => $_node_id));?>';
    }
}
</script>
